﻿@model WebApplication3.Models.OrderViewModel
@{
	ViewData["Title"] = "Index";
	Layout = null;
}
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<title>订单</title>
	<link href="~/weui.css" rel="stylesheet" />
	<style>
		html, body {
			height: 100%;
			background-color: #f8f8f8;
		}

		body {
			font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif;
		}

		.item {
			padding: 10px 0;
		}

		.item__title {
			margin-bottom: 5px;
			padding-left: 15px;
			padding-right: 15px;
			color: #999;
			font-weight: normal;
			font-size: 14px;
		}

		.item__ctn {
			padding: 0 15px;
		}

		.page_feedback {
			padding: 15px;
			overflow: auto;
			background-color: #FFFFFF;
		}
		/*fix fastclick很难点中的bug*/
		label > * {
			pointer-events: none;
		}
		/* weui需要fix的 */
		.weui-picker__item {
			padding: 0;
			height: 34px;
			line-height: 34px;
		}
	</style>
	 
	<script src="~/jquery.min.js"></script>
</head>
<body ontouchstart>
	<p id="bear"></p> 
	<div class="page">
		<div class="page__hd">
			<h1 class="page__title">订单</h1>
			<p class="page__desc">待处理</p>
		</div>
		<div class="page__bd page__bd_spacing">
			@foreach (var item in Model?.OrderDetails)
			{
			<a href="javascript:;" class="weui-btn weui-btn_default" id="a@item.Id"  data-id="@item.Id">
				寄托无:@item.ProductName,
							地址:@item.ReceiveAddress 收件人:@item.ReceiveName 电话:@item.ReceiveMobile
						</a>
				 
			}

			
			 
		</div>
		 

		<div id="dialogs">
			<!--BEGIN dialog1-->
			<div class="js_dialog" id="iosDialog1" style="display: none;">
				<div class="weui-mask"></div>
				<div class="weui-dialog">
					<div class="weui-dialog__hd"><strong class="weui-dialog__title">确定接单吗</strong></div>
					<div class="weui-dialog__bd itemInfo"> </div>
					<div class="weui-dialog__ft">
						<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">取消</a>
						<a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">接单</a>
					</div>
				</div>
			</div>
			<!--END dialog1-->
			 
			 
			 
		</div>
	</div>
 
</body>
</html>
<script>
	var orderId =0;
	$(function () {
		var $iosDialog1 = $('#iosDialog1');
		//对话框取消
		$('#dialogs').on('click', '.weui-dialog__btn_default', function () {
			console.log('xxx');
			$(this).parents('.js_dialog').fadeOut(200);
		});//对话框 接单
		$('#dialogs').on('click', '.weui-dialog__btn_primary', function () {
			console.log('xxx2');
			$.post("/Courier/ActionOrder", { "id": orderId }, function (res) {
				 
			});
			$(this).parents('.js_dialog').fadeOut(200);
		});//弹窗对话框
		$('.page__bd_spacing>a').click(function () {
			var id = $(this).attr("data-id");
			console.log(id);
			orderId = id;
			var text = $(this).text();
			$(".itemInfo").text(text);
			console.log(text);
			$iosDialog1.fadeIn(200);
		});

		$('#showIOSDialog1').on('click', function () {
			//$iosDialog1.fadeIn(200);
		});

	});

 

</script>